package com.baizhi.cmfz.appcontroller;

import com.baizhi.cmfz.entity.Audio;
import com.baizhi.cmfz.service.AudioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("audio")
public class AudioController {
    @Autowired
    private AudioService audioService;
    //根据专辑id 查询出该专辑下的所有音频
    @GetMapping("selectAudioByAlbumId/{albumId}")
    public List<Audio> selectAudioByAlbumId(@PathVariable("albumId") int albumId) {
        return audioService.selectAudioByAlbumId(albumId);
    }
}
